﻿
using Xacml.Core;
using System.Xml;

namespace Xacml.Core.Policy
{
  public class SubjectMatchElement : TargetMatchBase
  {
    public override bool IsReadOnly
    {
      get
      {
        return true;
      }
    }

    public SubjectMatchElement(string matchId, AttributeValueElementReadWrite attributeValue, AttributeReferenceBase attributeReference, XacmlVersion version)
      : base(matchId, attributeValue, attributeReference, version)
    {
    }

    public SubjectMatchElement(XmlReader reader, XacmlVersion version)
      : base(reader, "SubjectMatch", "SubjectAttributeDesignator", version)
    {
    }

    protected override AttributeDesignatorBase CreateAttributeDesignator(XmlReader reader)
    {
      return (AttributeDesignatorBase) new SubjectAttributeDesignatorElement(reader, this.SchemaVersion);
    }
  }
}
